useradd tjhk
passwd tjhk@1817

// 数据目录最好在data下
sudo mkdir /usr/zookeeper
sudo chown -R tjhk:tjhk /usr/zookeeper/
cd /usr/zookeeper
wget https://mirrors.tuna.tsinghua.edu.cn/apache/zookeeper/zookeeper-3.7.0/apache-zookeeper-3.7.0-bin.tar.gz
tar -zxvf apache-zookeeper-3.7.0-bin.tar.gz

// 修改数据存储路径  // 可修改为主机名 但是需要修改hosts文件
sudo mv apache-zookeeper-3.7.0-bin/conf/zoo_sample.cfg apache-zookeeper-3.7.0-bin/conf/zoo.cfg
sudo tee -a apache-zookeeper-3.7.0-bin/conf/zoo.cfg <<-'EOF'
server.1=192.168.33.21:2888:3888
server.2=192.168.33.22:2888:3888
server.3=192.168.33.23:2888:3888
EOF
sudo mkdir /tmp/zookeeper/
sudo chown -R tjhk:tjhk /tmp/zookeeper/
echo  1 > /tmp/zookeeper/myid // 需修改




# 设置白名单
setAcl / ip:127.0.0.1:cdrwa,ip:192.168.42.2:cdrwa,ip:192.168.42.3:cdrwa,ip:192.168.42.4:cdrwa,ip:192.168.42.5:cdrwa,ip:192.168.42.6:cdrwa,ip:192.168.42.7:cdrwa,ip:192.168.42.8:cdrwa
